package com.sudichina.sudichina.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by mccccccmike on 2016/8/26.
 * {id=37.0, status=null, gmtCreate=1.472107874E12, gmtModified=1.472109147E12,
 * accountName=13716556242, accountPassword=657E2C446F48D3AA, idCard=null,
 * realname=null, accountType=0, clientIp=0, agentAccountId=null,
 * logStringimes=0.0, source=0, accountDegree=0.0, nickName=0, note3=null,
 * tradePassword=null, contactTel=null, crtDate=1.472107874E12,
 * isTempAccount=false, wechatOpenId=null, invalid=false, auth=false,
 * online=false, lock=false} code = 1 success true]
 */
public class User implements Parcelable{
    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", status='" + status + '\'' +
                ", gmtCreate=" + gmtCreate +
                ", gmtModified=" + gmtModified +
                ", accountName='" + accountName + '\'' +
                ", accountPassword='" + accountPassword + '\'' +
                ", idCard='" + idCard + '\'' +
                ", realname='" + realname + '\'' +
                ", accountType='" + accountType + '\'' +
                ", clientIp='" + clientIp + '\'' +
                ", agentAccountId='" + agentAccountId + '\'' +
                ", source='" + source + '\'' +
                ", accountDegree='" + accountDegree + '\'' +
                ", nickName='" + nickName + '\'' +
                ", note3='" + note3 + '\'' +
                ", tradePassword='" + tradePassword + '\'' +
                ", contactTel='" + contactTel + '\'' +
                ", wechatOpenId='" + wechatOpenId + '\'' +
                ", online=" + online +
                ", auditStatus='" + auditStatus + '\'' +
                '}';
    }

    private long id;
    private String status;
    private long gmtCreate;
    private long gmtModified;
    private String accountName;
    private String accountPassword;
    private String idCard;
    private String realname;
    private String accountType;
    private String clientIp;
    private String agentAccountId;
    private String source;
    private String accountDegree;
    private String nickName;
    private String note3;
    private String tradePassword;
    private String contactTel;
    private String wechatOpenId;
    private boolean online;
    private String auditStatus;

    public User(long id) {
        this.id = id;
    }

    public User(String accountName, String accountPassword) {
        this.accountName = accountName;
        this.accountPassword = accountPassword;
    }

    public User(long id, String status, long gmtCreate, long gmtModified, String accountName, String accountPassword, String idCard, String realname, String accountType, String clientIp, String agentAccountId, String source, String accountDegree, String nickName, String note3, String tradePassword, String contactTel, String wechatOpenId, boolean online, String auditStatus) {
        this.id = id;
        this.status = status;
        this.gmtCreate = gmtCreate;
        this.gmtModified = gmtModified;
        this.accountName = accountName;
        this.accountPassword = accountPassword;
        this.idCard = idCard;
        this.realname = realname;
        this.accountType = accountType;
        this.clientIp = clientIp;
        this.agentAccountId = agentAccountId;
        this.source = source;
        this.accountDegree = accountDegree;
        this.nickName = nickName;
        this.note3 = note3;
        this.tradePassword = tradePassword;
        this.contactTel = contactTel;
        this.wechatOpenId = wechatOpenId;
        this.online = online;
        this.auditStatus = auditStatus;
    }

    protected User(Parcel in) {
        id = in.readLong();
        status = in.readString();
        gmtCreate = in.readLong();
        gmtModified = in.readLong();
        accountName = in.readString();
        accountPassword = in.readString();
        idCard = in.readString();
        realname = in.readString();
        accountType = in.readString();
        clientIp = in.readString();
        agentAccountId = in.readString();
        source = in.readString();
        accountDegree = in.readString();
        nickName = in.readString();
        note3 = in.readString();
        tradePassword = in.readString();
        contactTel = in.readString();
        wechatOpenId = in.readString();
        online = in.readByte() != 0;
        auditStatus = in.readString();
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel in) {
            return new User(in);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public long getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(long gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public long getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(long gmtModified) {
        this.gmtModified = gmtModified;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public String getAccountPassword() {
        return accountPassword;
    }

    public void setAccountPassword(String accountPassword) {
        this.accountPassword = accountPassword;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public String getAccountType() {
        return accountType;
    }

    public void setAccountType(String accountType) {
        this.accountType = accountType;
    }

    public String getClientIp() {
        return clientIp;
    }

    public void setClientIp(String clientIp) {
        this.clientIp = clientIp;
    }

    public String getAgentAccountId() {
        return agentAccountId;
    }

    public void setAgentAccountId(String agentAccountId) {
        this.agentAccountId = agentAccountId;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getAccountDegree() {
        return accountDegree;
    }

    public void setAccountDegree(String accountDegree) {
        this.accountDegree = accountDegree;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getNote3() {
        return note3;
    }

    public void setNote3(String note3) {
        this.note3 = note3;
    }

    public String getTradePassword() {
        return tradePassword;
    }

    public void setTradePassword(String tradePassword) {
        this.tradePassword = tradePassword;
    }

    public String getContactTel() {
        return contactTel;
    }

    public void setContactTel(String contactTel) {
        this.contactTel = contactTel;
    }

    public String getWechatOpenId() {
        return wechatOpenId;
    }

    public void setWechatOpenId(String wechatOpenId) {
        this.wechatOpenId = wechatOpenId;
    }

    public boolean isOnline() {
        return online;
    }

    public void setOnline(boolean online) {
        this.online = online;
    }

    public String getAuditStatus() {
        return auditStatus;
    }

    public void setAuditStatus(String auditStatus) {
        this.auditStatus = auditStatus;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(id);
        dest.writeString(status);
        dest.writeLong(gmtCreate);
        dest.writeLong(gmtModified);
        dest.writeString(accountName);
        dest.writeString(accountPassword);
        dest.writeString(idCard);
        dest.writeString(realname);
        dest.writeString(accountType);
        dest.writeString(clientIp);
        dest.writeString(agentAccountId);
        dest.writeString(source);
        dest.writeString(accountDegree);
        dest.writeString(nickName);
        dest.writeString(note3);
        dest.writeString(tradePassword);
        dest.writeString(contactTel);
        dest.writeString(wechatOpenId);
        dest.writeByte((byte) (online ? 1 : 0));
        dest.writeString(auditStatus);
    }
}
